<?php

use App\Models\Fee\FeeAnnualChangesModel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddRemarkToFeeAnnualChangesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('fee_annual_changes', function (Blueprint $table) {
            $table->string('remark')->default('')->comment('备注');
            $table->string('image')->default('')->comment('备注图片');
        });

//        FeeAnnualChangesModel::query()->get()->each(function ($item) {
//            $item->remark = $item->content;
//            $item->save();
//
//            dump($item->id);
//        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('fee_annual_changes', function (Blueprint $table) {
            $table->dropColumn('remark');
            $table->dropColumn('image');
        });
    }
}
